//
//  AnnouncementDetailVC.m
//  u76ho
//
//  Created by m-air-01 on 15/12/28.
//  Copyright © 2015年 LV. All rights reserved.
//

#import "AnnouncementDetailVC.h"

@interface AnnouncementDetailVC ()

@end

@implementation AnnouncementDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self main];
    
    self.navigationItem.title = @"企业公告";
  //  [self addNavgationBar];
  //  [self addBackItem];
    // Do any additional setup after loading the view.
}
-(void)main
{
    //标题
    [self.view setBackgroundColor:[UIColor whiteColor]];
    UILabel * titleLab = [[UILabel alloc]initWithFrame:CGRectMake(SIZETO6W(20), 84, SCREEN_WIDTH-SIZETO6W(20), 30)];
    titleLab.text = @"上海XX服饰商行公告";
//    titleLab.font = HeitiFont(18);
    titleLab.textColor = UIColorFromRGB(0x323943);
    titleLab.textAlignment = NSTextAlignmentLeft;
    [self.view addSubview:titleLab];
    
    //时间
    NSString * timeStr = @"2014-12-21";
    UILabel * timeLab = [[UILabel alloc]initWithFrame:CGRectMake(SIZETO6W(20),titleLab.bottom, SCREEN_WIDTH-SIZETO6W(20), 30)];
    timeLab.text = timeStr;
//    timeLab.font = HeitiFont(15);
    timeLab.font = [UIFont systemFontOfSize:15];
    timeLab.textColor = UIColorFromRGB(0x94999f);
    [self.view addSubview:timeLab];
    
    //内容
    UILabel * contentLab = [[UILabel alloc]initWithFrame:CGRectMake(SIZETO6W(20), timeLab.bottom, SCREEN_WIDTH-SIZETO6W(20)*2, SCREEN_HEIGHT/2)];
    contentLab.numberOfLines = 0;
    contentLab.font = HeitiFont(14);
    NSString * contentStr = @"上海X X服饰商行是一家经营多年的外贸服饰系列的连锁零售批发企业，在上海西南地区有一定影响力，主要分布在长宁、徐汇、静安三区，面积从十几至近二百平方米不等的九家门店，在市中心有一处近六百平方米的物流仓库。现因企业拥有者将赴国外，有意将属下门店和仓库全部转让(其中包括门店和仓库中价值三百多万元人民币的货物和经营权、固定资产、各门店的押金和已支付的剩余房租)。本企业无债权债务，如有可公证，和接收方无涉。本企业运作良好，获利可观，转让价格为陆百万元人民币。";
    // 调整行间距
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:contentStr];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:8.0];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [contentStr length])];
    contentLab.attributedText = attributedString;
    [self.view addSubview:contentLab];
}
#pragma  mark - 返回按钮图标
-(void)addBackItem{
    UIButton * backItem = [UIButton buttonWithType:UIButtonTypeCustom];
    backItem.frame = CGRectMake(0, 0, 9, 17);
    [backItem setImage:[UIImage imageNamed:@"返回图标"] forState:UIControlStateNormal];
    [backItem addTarget:self action:@selector(backItem:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backItem];
}
-(void)backItem:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - NAVgationBarTitle


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
